# coding: utf-8
from sqlalchemy import Column, Date, DateTime, Float, Integer, String, text
from sqlalchemy.ext.declarative import declarative_base


Base = declarative_base()
metadata = Base.metadata


class FinancialIndicatorDay(Base):
    __tablename__ = 'financial_indicator_day'

    id = Column(Integer, primary_key=True)
    code = Column(String(12), nullable=False)
    day = Column(Date, nullable=False, server_default=text("'0000-00-00'"))
    pubDate = Column(Date, nullable=False, server_default=text("'0000-00-00'"))
    statDate = Column(Date, nullable=False, server_default=text("'0000-00-00'"))
    periodStart = Column(Date, nullable=False, server_default=text("'0000-00-00'"))
    periodEnd = Column(Date, nullable=False, server_default=text("'0000-00-00'"))
    reportId = Column(Integer, nullable=False, server_default=text("'0'"))
    eps = Column(Float(20))
    adjusted_profit = Column(Float(20))
    operating_profit = Column(Float(20))
    value_change_profit = Column(Float(20))
    roe = Column(Float(20))
    inc_return = Column(Float(10))
    roa = Column(Float(10))
    net_profit_margin = Column(Float(10))
    gross_profit_margin = Column(Float(10))
    expense_to_total_revenue = Column(Float(10))
    operation_profit_to_total_revenue = Column(Float(10))
    net_profit_to_total_revenue = Column(Float(10))
    operating_expense_to_total_revenue = Column(Float(10))
    ga_expense_to_total_revenue = Column(Float(10))
    financing_expense_to_total_revenue = Column(Float(10))
    operating_profit_to_profit = Column(Float(10))
    invesment_profit_to_profit = Column(Float(10))
    adjusted_profit_to_profit = Column(Float(10))
    goods_sale_and_service_to_revenue = Column(Float(10))
    ocf_to_revenue = Column(Float(10))
    ocf_to_operating_profit = Column(Float(10))
    inc_total_revenue_year_on_year = Column(Float(10))
    inc_total_revenue_annual = Column(Float(10))
    inc_revenue_year_on_year = Column(Float(10))
    inc_revenue_annual = Column(Float(10))
    inc_operation_profit_year_on_year = Column(Float(10))
    inc_operation_profit_annual = Column(Float(10))
    inc_net_profit_year_on_year = Column(Float(10))
    inc_net_profit_annual = Column(Float(10))
    inc_net_profit_to_shareholders_year_on_year = Column(Float(10))
    inc_net_profit_to_shareholders_annual = Column(Float(10))
    status = Column(Integer, nullable=False, server_default=text("'0'"))
    addTime = Column(DateTime, nullable=False, server_default=text("'0000-00-00 00:00:00'"))
    modTime = Column(DateTime, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
